#ifndef W25QXX_h
#define W25QXX_h

#include "stm32f10x.h"  

#define	W25Qxx_CS_CLK		RCC_APB2Periph_GPIOB
#define	W25Qxx_CS_PORT		GPIOB
#define	W25Qxx_CS_PIN		GPIO_Pin_6


#define	W25Qxx_CS_L			GPIO_ResetBits(W25Qxx_CS_PORT,W25Qxx_CS_PIN)
#define	W25Qxx_CS_H			GPIO_SetBits(W25Qxx_CS_PORT,W25Qxx_CS_PIN)


void W25Qxx_INit(void);
u16 Read_ID(void);
void read_id(void);
void W25Qxx_Write_Enable(void);
u8 W25Qxx_Read_Status(void);
void W25Qxx_Wait_Busy(void);
void W25Qxx_Write_Data(u32 Write_Add,u16 Write_Number,char *Write_First);
void W25Qxx_Read_Data(u32 Read_Add,u32 Read_Num,char *Data);
void W25Qxx_Chip_Erase(void);
void W25Qxx_Sector_Erase(u32 Sec_Num);

#endif
